package org.eiahe.hr.attendance.service;

import org.eiahe.hr.attendance.domain.bo.LeaveApplicationBo;
import org.eiahe.hr.attendance.domain.vo.LeaveApplicationVo;
import org.ehe.common.mybatis.core.page.PageQuery;
import org.ehe.common.mybatis.core.page.TableDataInfo;

import java.util.Collection;
import java.util.List;

/**
 * 请假申请Service接口
 *
 * @author zhangnn
 */
public interface ILeaveApplicationService {

    /**
     * 查询请假申请
     */
    LeaveApplicationVo queryById(Long applicationId);

    /**
     * 查询请假申请列表
     */
    TableDataInfo<LeaveApplicationVo> queryPageList(LeaveApplicationBo bo, PageQuery pageQuery);

    /**
     * 查询请假申请列表
     */
    List<LeaveApplicationVo> queryList(LeaveApplicationBo bo);

    /**
     * 新增请假申请
     */
    Boolean insertByBo(LeaveApplicationBo bo);

    /**
     * 修改请假申请
     */
    Boolean updateByBo(LeaveApplicationBo bo);

    /**
     * 校验并批量删除请假申请信息
     */
    Boolean deleteWithValidByIds(Collection<Long> ids);

    /**
     * 审批通过
     *
     * @param applicationId 申请ID
     * @return 是否成功
     */
    Boolean approve(Long applicationId);

    /**
     * 审批拒绝
     *
     * @param applicationId 申请ID
     * @param rejectReason  拒绝原因
     * @return 是否成功
     */
    Boolean reject(Long applicationId, String rejectReason);
}
